-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
#9191 mass energy eqivalence #9217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#9191 mass energy eqivalence #9217
Conversation
Einstein's Mass-Energy Equivalence E=MC^2
Einstein's Mass-Energy Equivalence E=MC^2 #9191
feature#9191
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhsuhail00 Maybe this should go in conversions/
physics/mass_energy_equivalence.py
Outdated
# Calculate energy using the equation E=mc^2 | ||
energy = mass * m.pow(speed_of_light, 2) | ||
# return value has unit Joules | ||
return energy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having comments explain each line, please explain the equation and the input and output types in the function docstring
Co-authored-by: Tianyi Zheng <[email protected]>
Co-authored-by: Tianyi Zheng <[email protected]>
Co-authored-by: Tianyi Zheng <[email protected]>
Co-authored-by: Tianyi Zheng <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated the suggestions made.
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done the suggested changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done all the suggested changes and passed the checks.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
The function takes a single argument mass(in kg) having datatype float and | ||
returns the energy(in joule) having datatype float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a description of the function, so please put it in the function's docstring rather than the header string.
Here it defines a Function to calculate energy(in joules) equivalent of a given | ||
mass(in kilograms) using Einstein's Mass-energy equivalence equation E=mc^2 | ||
where m is mass and c = 299,792,458 meter per second is the speed of light | ||
in vacuum (a constant value). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it defines a Function to calculate energy(in joules) equivalent of a given | |
mass(in kilograms) using Einstein's Mass-energy equivalence equation E=mc^2 | |
where m is mass and c = 299,792,458 meter per second is the speed of light | |
in vacuum (a constant value). | |
This file defines a function to calculate energy (in joules) equivalent to a given | |
mass (in kilograms) using Einstein's mass-energy equivalence equation E=mc^2, | |
where m is mass and c = 299,792,458 m/s is the speed of light in a vacuum. |
Fixes for grammar, formatting, and wording
Describe your change:
Feature #9191
I have added a module to calculate energy equivalence by mass. Taking mass in kilograms and giving result in Joules.
the function names calculate_energy() which returns a floating value.
Checklist: